#include "mainwindow.h"
#include "scene.h"
#include <iostream>
#include <gtkglmm.h>
#include <GL/gl.h>
#include <GL/glu.h>

namespace moogle
{
  main_window::main_window(const Glib::RefPtr<const Gdk::GL::Config>& config)
    : _vbox(false, 0), _scene(config, new scene), _quit_btn("Quit")
  {
    set_title("Gtk::GL::DrawingArea");

    // Get automatically redrawn if any of their children changed allocation.
    set_reallocate_redraws(true);
    _scene.set_size_request(300, 300);

    // Fill vertical box layout
    add(_vbox);
    _vbox.pack_start(_scene);
    _vbox.pack_start(_quit_btn, Gtk::PACK_SHRINK, 0);

    // Show window
    show_all();
  }

  main_window::~main_window()
  {
  }

  void main_window::on_button_quit_clicked()
  {
    Gtk::Main::quit();
  }
}
